package com.eh.template.beverage;

/**
 * Created by David on 2016/4/30.
 */
public abstract class CaffeinBeverage {
    public final void prepareRecipe() {
        boilWater();
        brew(); // 冲泡
        pourInCup();
        if (isCondimentsEnough()) {
            addCondiments();
        }
    }

    private void boilWater() {
        System.out.println("把水煮沸");
    }

    private void pourInCup() {
        System.out.println("把饮料倒进被子");
    }

    protected abstract void brew();

    protected abstract void addCondiments();

    protected boolean isCondimentsEnough() {
        return true;
    }
}
